package reflection;

import annotation.MyAnno;

/**
 * @author LiuYan
 * @date 2021/11/16 16:05
 */

public class Part02 {

    public static void main(String[] args) {

        Class<Person> personClass = Person.class;

        boolean annotationPresent = personClass.isAnnotationPresent(MyAnno.class);

        if (annotationPresent) {
            MyAnno annotation = personClass.getAnnotation(MyAnno.class);
            System.out.println(annotation.season());

            // 获取注解中的注解值报错
            // System.out.println(annotation.myAnno2());
        }


    }
}
